<template>
  <div class="dialog-lahei">
    <my-form
      :myform="form"
      :myrules="rules"
      :fname="fname"
      @value="updata"
      @close="close"
      success="创建工单成功"
      :clear="true"
    ></my-form>
  </div>
</template>

<script>
import MyForm from "@/components/MyInput/MyForm";
export default {
  props: ["fname"],
  components: {
    MyForm,
  },
  data() {
    return {
      form: {
        gdfl: "",
        gdbt: "",
        gdms: "",
        f: {
          f1: {
            label: "工单分类",
            type: "select",
            prop: "gdfl",
            setting: {
              ph: "请选择",
              width: 320,
              items: [
                {
                  label: "分类一",
                  value: 0,
                },
                {
                  label: "分类二",
                  value: 1,
                },
                {
                  label: "分类三",
                  value: 2,
                },
              ],
            },
          },
          f2: {
            label: "工单标题",
            type: "input",
            prop: "gdbt",
            setting: {
              ph: "请输入工单标题",
              width: 320,
            },
          },
          f3: {
            label: "工单描述",
            type: "textarea",
            prop: "gdms",
            setting: {
              ph: "请输入工单描述",
              rows: 8,
              width: 320,
            },
          },
          f4: {
            label: "",
            type: "text",
            prop: "",
            setting: {
              text: "📎 添加附件（最多上传5个附件，单个文件最大20M)",
            },
          },
          f6: {
            label: "抄送人",
            type: "select",
            prop: "",
            setting: {
              ph: '请选择',
              width: 320,
              items: [
                {
                  label: "王美美",
                  value: 0,
                },
                {
                  label: "七尾",
                  value: 1,
                },
                {
                  label: "李想",
                  value: 2,
                },
              ],
            },
          },
          f7: {
            label: "优先级",
            type: "radio",
            prop: "",
            setting: {
            },
          },
          f8: {
            label: "工单状态",
            type: "select",
            prop: "",
            setting: {
              ph: '请选择',
              width: 320,
              items: [
                {
                  label: "王美美",
                  value: 0,
                },
                {
                  label: "七尾",
                  value: 1,
                },
                {
                  label: "李想",
                  value: 2,
                },
              ],
            },
          },
          f9: {
            label: "受理客服组",
            type: "select",
            prop: "",
            setting: {
              ph: '请选择',
              width: 320,
              items: [
                {
                  label: "客服组一",
                  value: 0,
                },
                {
                  label: "客服组二",
                  value: 1,
                },
                {
                  label: "客服组三",
                  value: 2,
                },
              ],
            },
          },
          f10: {
            label: "受理客服",
            type: "select",
            prop: "",
            setting: {
              ph: '请选择',
              width: 320,
              items: [
                {
                  label: "王美美",
                  value: 0,
                },
                {
                  label: "七尾",
                  value: 1,
                },
                {
                  label: "李想",
                  value: 2,
                },
              ],
            },
          },
          f11: {
            label: "所属客户",
            type: "select",
            prop: "",
            setting: {
              ph: '请选择',
              width: 320,
              items: [
                {
                  label: "王美美",
                  value: 0,
                },
                {
                  label: "七尾",
                  value: 1,
                },
                {
                  label: "李想",
                  value: 2,
                },
              ],
            },
          },
        },
      },
      rules: {
          gdfl: [
              {required: true, message: '请输入工单分类', trigger: 'blur' }
          ],
          gdbt: [
              {required: true, message: '请选择活动区域', trigger: 'change' }
          ],
          gdms:[
              {required: true, message: '请输入工单描述', trigger: 'blur' }
          ]
      },
    };
  },
  methods: {
    updata(obj) {
      console.log("obj");
      console.log(obj);
      this.form[obj.propname] = obj.valuename;
    },
    close() {
      this.$emit("close", false);
    },
  },
};
</script>

<style>
</style>